package fr.charlott.batch;

import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.annotation.AfterStep;
import org.springframework.batch.core.annotation.BeforeStep;

public class AnnotationStepExecutionListener {

    private boolean passedBefore = false;

    private boolean passedAfter = false;

    private StepExecution stepExecution = null;

    @BeforeStep
    public void before() {
        passedBefore = true;
    }

    @AfterStep
    public void after(StepExecution stepExecution) {
        passedAfter = true;
        this.stepExecution = stepExecution;
    }

    public boolean isPassedBefore() {
        return passedBefore;
    }

    public boolean isPassedAfter() {
        return passedAfter;
    }

    public StepExecution getStepExecution() {
        return stepExecution;
    }

}
